﻿#pragma once
#include "AsGraphicsItem.h"

__AS_JY(Update 2023.1.7)
class AS_GRAPHICS_API AsGraphicsPolylineItem : public AsGraphicsItem {
public:
	explicit AsGraphicsPolylineItem(QGraphicsItem *parent = nullptr);
	AsGraphicsPolylineItem(const AG::PolylineF& polyline, QGraphicsItem *parent = nullptr);
	AsGraphicsPolylineItem(const AG::PolylineF& polyline, const QPen& pen = QPen(), QGraphicsItem *parent = nullptr);
	virtual ~AsGraphicsPolylineItem();

private:
	AG::PolylineF mPolyline;
	bool mbClosed;

private:
	void updateBoundingRect();

protected:
	void paint(QPainter* painter) override;

public:
	void setPolyline(const AG::PolylineF& polyline);
	void setPolylineClosed(bool isClosed);

};

namespace AsGraphicsNamespace {
	typedef AsGraphicsPolylineItem PolylineItem;
};